<template>
    <div>
        <avue-form :option="modelOption" v-model="modelForm" @submit="handleSubmit"></avue-form>
    </div>

</template>

<script>

    export default {
        name: "menu-form",
        watch: {
            'form.parentId'(n, o) {
                this.modelForm=this.form
            },
            'form.id'(n, o) {
                this.modelForm=this.form
            }

        },
        model: {
            prop: 'form',//指向props的参数名
            event: 'returnBack'//事件名称
        },
        props: {
            form: {
                type: Object
            },
            option: {
                type: Object
            }
        },
        data() {
            return {
                modelForm: this.form,
                modelOption: this.option
            }
        },

        methods: {
            handleSubmit(form, done) {
                this.$emit("submit", form, done);

            }
        }
    }
</script>

<style scoped>

</style>
